package com.cai.mvvm;

import com.alibaba.android.arouter.launcher.ARouter;
import com.mvvm.library.app.XMvvm;
import com.mvvm.library.common.GlobalConstant;
import com.tencent.bugly.crashreport.CrashReport;


/**
 * @创建时间：2022/7/6
 * @作者：小蔡
 * @功能介绍：
 */
public class BaseApplication extends XMvvm {
    public static BaseApplication getBaseInstance() {
        return baseApplication;
    }

    private static BaseApplication baseApplication;


    @Override
    public String initBaseUrl() {
        return GlobalConstant.HTTPS_URL;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        baseApplication = this;
        CrashReport.initCrashReport(getApplicationContext(), "725a743883", false); //腾讯bug反馈初始化
        initARoute();//初始化阿里路由
    }


    /**
     * 初始化阿里路由
     */
    private void initARoute() {
        ARouter.openDebug();
        ARouter.openLog();
        ARouter.init(this);
    }


    @Override
    public void onTerminate() {
        super.onTerminate();
        ARouter.getInstance().destroy();
    }
}
